<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
    xmlns:s="http://jboss.com/products/seam/taglib"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:rich="http://richfaces.org/rich"
	xmlns:a="http://richfaces.org/a4j"
    template="/layout/template.xhtml">

<ui:define name="body">
	<h:form id="createTravelFormId">
		<h:outputText value="#{userData.login}"/>
		
		<rich:panel>
			<f:facet name="header">User information</f:facet>   
			<h:panelGrid >  
			<s:decorate id="requestNameField" template="/layout/edit.xhtml">
                <ui:define name="label">Name</ui:define>
                <rich:inplaceInput value="#{userData.name}"  showControls="true" required="true" />
            </s:decorate>

			<s:decorate id="requestSurnameField" template="/layout/edit.xhtml">
                <ui:define name="label">Surname</ui:define>
                <rich:inplaceInput value="#{userData.surname}"  showControls="true" required="true" />
            </s:decorate>
            
            
            <s:decorate id="birthDateField" template="/layout/edit.xhtml">
	                <ui:define name="label">Birth date</ui:define>
	                <rich:calendar required="true"
	                          value="#{userData.birthDate}" datePattern="MM/dd/yyyy" firstWeekDay="1"/>
	        </s:decorate>
	        
	        
            
            
            <h:panelGroup id="info" >
                <rich:panel bodyClass="info" >
                	<h:panelGrid columns="2">
						<s:div>

							<h:outputText  value="Big"/>
		                    <s:graphicImage id="avatarBigId" rendered="#{userDataBean.avatarBig != null}" value="#{userDataBean.avatarBig.image}" fileName="#{userDataBean.avatarBig.name}" />
		    				<h:graphicImage value="/img/icons/no_avatar.jpg" rendered="#{userDataBean.avatarBig == null}"/>
		    				
		    				<h:outputText  value="Medium"/>
		                    <s:graphicImage id="avatarMediumId" rendered="#{userDataBean.avatarMedium != null}" value="#{userDataBean.avatarMedium.image}" fileName="#{userDataBean.avatarMedium.name}" />
		    				<h:graphicImage value="/img/icons/no_avatar.jpg" rendered="#{userDataBean.avatarMedium == null}"/>
		    				
		    				<h:outputText  value="Small"/>
		                    <s:graphicImage id="avatarSmallId" rendered="#{userDataBean.avatarSmall != null}" value="#{userDataBean.avatarSmall.image}" fileName="#{userDataBean.avatarSmall.name}" />
		    				<h:graphicImage value="/img/icons/no_avatar.jpg" rendered="#{userDataBean.avatarSmall == null}"/>
    					</s:div>
    					<rich:fileUpload  fileUploadListener="#{userDataBean.fileUploadListener}" acceptedTypes="*" listHeight="0" listWidth="80">
                			<a:support event="onuploadcomplete" reRender="info"/>
            			</rich:fileUpload>	
    				</h:panelGrid>
                </rich:panel>
                
               
            </h:panelGroup>
            


            </h:panelGrid>
		</rich:panel>
		
		<div class="actionButtons">

            <h:commandButton id="save"
                          value="Save"
                         action="#{userDataBean.saveUserDataAction}"/>
        </div>
	</h:form>		

</ui:define>
</ui:composition>
